/***************************  pro-table start  ***************************/

/* custom card */
.card {
  box-sizing: border-box;
  padding: 10px;
  overflow-x: hidden;
  background-color: var(--el-bg-color);
  border-radius: 6px;
}

/* ProTable 不需要 card 样式（在组件内使用 ProTable 会使用到） */
.no-card {
  .card {
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .table-search {
    padding: 18px 0 0 !important;
    margin-bottom: 0 !important;
  }
}

/* content-box (常用内容盒子) */
.content-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;

  .text {
    margin: 20px 0 30px;
    font-size: 23px;
    font-weight: bold;
    color: var(--el-text-color-regular);
  }

  .el-descriptions {
    width: 100%;
    padding: 40px 0 0;

    .el-descriptions__title {
      font-size: 18px;
    }

    .el-descriptions__label {
      width: 200px;
    }
  }
}

/* main-box (树形表格 treeFilter 页面会使用，左右布局 flex) */
.main-box {
  display: flex;
  width: 100%;
  height: 100%;

  .table-box {
    // 这里减去的 230px 是 treeFilter 组件宽度
    width: calc(100% - 230px);
  }
}
// 表格容器自适应高度
.table-container {
  position: absolute;
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 8px;
}

.table-box,
.table-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  height: 100%;

  // table-search 表格搜索样式
  .table-search {
    padding: 18px 18px 0;
    margin-bottom: 5px;

    .el-form {
      .el-form-item__content > * {
        width: 100%;
      }

      // 去除时间选择器上下 padding
      .el-range-editor.el-input__wrapper {
        padding: 0 10px;
      }
    }

    .operation {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      margin-bottom: 18px;
    }
  }

  // 表格 header 样式
  .table-header {
    .header-button-lf {
      float: left;
    }

    .header-button-ri {
      float: right;
    }

    .el-button {
      margin-bottom: 15px;
    }
  }

  // el-table 表格样式

  .el-table {
    display: flex;
    flex: 1;
    flex-direction: column;

    .el-table__inner-wrapper {
      .el-table__body-wrapper {
        display: flex;
        flex: 1;
        flex-direction: column;

        .el-scrollbar {
          flex: 1;
        }
      }
    }
    // 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
    table {
      width: 100%;
    }

    .el-table__header th {
      height: 45px;
      font-size: 15px;
      font-weight: bold;
      color: var(--el-text-color-primary);
      background: var(--g-table-th-bg);
    }

    .el-table__row {
      height: 45px;
      font-size: 14px;

      .move {
        cursor: move;

        .el-icon {
          cursor: move;
        }
      }
    }

    // 设置 el-table 中 header 文字不换行，并省略
    .el-table__body tr.current-row > td.el-table__cell {
      background: var(--g-table-th-bg);
    }

    .el-table__header .el-table__cell > .cell {
      // white-space: nowrap;
      white-space: wrap;
    }

    // 解决表格数据为空时样式不居中问题(仅在element-plus中)
    .el-table__empty-block {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);

      .table-empty {
        line-height: 30px;
      }
    }

    // table 中 image 图片样式
    .table-image {
      width: 50px;
      height: 50px;
      border-radius: 50%;
    }
  }

  // 表格 pagination 样式
  .el-pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
  }
}

/* el-table 组件大小 */
.el-table--small {
  .el-table__header th {
    height: 40px !important;
    font-size: 14px !important;
  }

  .el-table__row {
    height: 40px !important;
    font-size: 13px !important;
  }
}

.el-table--large {
  .el-table__header th {
    height: 50px !important;
    font-size: 16px !important;
  }

  .el-table__row {
    height: 50px !important;
    font-size: 15px !important;
  }
}

/***************************  pro-table end  ***************************/

/***************************  element-ui样式覆盖 start  ***************************/
// 气泡卡片样式覆盖
.el-popover.el-popper {
  border-radius: 10px;
}
// 分页样式覆盖 start
.el-pagination .el-select {
  width: 110px;
}
// 抽屉样式覆盖
.el-drawer__header {
  flex-direction: row-reverse;
  margin: 0;

  .el-drawer__close-btn {
    padding: 0;
    margin-right: 10px;
  }
}
// 抽屉样式覆盖
.el-select-dropdown {
  width: 100%;
}

.el-select-dropdown__empty {
  max-height: 500px !important;
}
// 颜色选择器样式覆盖
.el-color-predefine__colors {
  gap: 5px;

  .el-color-predefine__color-selector {
    width: 35px;
    margin: 0;
  }
}

/* 设置 notification、message 层级在 loading 之上 */
.el-message,
.el-notification {
  z-index: 2070 !important;
}

/***************************  element-ui样式覆盖 end  ***************************/
